/**
 * User: alesj
 * Date: 2004.8.11
 * Time: 15:09:39
 */

package com.generalynx.ecos.data;

import java.util.Collection;
import java.util.Set;
import java.io.Serializable;

import com.generalynx.common.data.ADEData;
import com.generalynx.common.resources.Resources;

/**
 * @hibernate.class table="erole" proxy="com.generalynx.ecos.data.Role"
 */
public class Role extends ADEData implements Serializable {

    private static final long serialVersionUID = 1L;

    private int m_id;
    private String m_rolename;
    private Set m_users;

    private Role role;
    private Collection buzers;

    public String getAddLabel() {
        return Resources.getString(Resources.ROLE);
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public Collection getBuzers() {
        return buzers;
    }

    public void setBuzers(Collection buzers) {
        this.buzers = buzers;
    }

    protected String getNameLabel() {
        return getRolename();
    }

    protected String getSelectAction() {
        return "roleSelect";
    }

    /**
     * @hibernate.id  column="erole_id" unsaved-value="0" generator-class="native"
     */
    public int getId() {
        return m_id;
    }

    public void setId(int id) {
        m_id = id;
    }

    /**
     * @hibernate.property
     */
    public String getRolename() {
        return m_rolename;
    }

    public void setRolename(String rolename) {
        m_rolename = rolename;
    }

    /**
     * @hibernate.set name="users" table="eusererole" cascade="none" lazy="true"
     * @hibernate.collection-key column="erole_id"
     * @hibernate.collection-many-to-many class="com.generalynx.ecos.data.User" column="euser_id"
     */
    public Set getUsers() {
        return m_users;
    }

    public void setUsers(Set users) {
        m_users = users;
    }

}
